package mcommand;

/**
 * Can set triggerTime, eventType, argument and argumentValue. Holds methods to
 * set and get them. Holds possible event types.
 *
 * @author Marcel, Christian, Klaus
 *
 */
public class Event {
    // defines a variable for the trigger value
    private float triggerTime;

    // defines a variable for the event type
    private EventType eventType;

    // sets up a argument as false
    private boolean argument = false;

    // defines a integer variable for arguments value
    private int argumentValue;

    /**
     * Sets the trigger time to the trigger time of the parameter. sets the
     * eventType to CREATE_ENEMY_MISSILE_EVERYTHING
     *
     * @param triggerTime triggerTime
     */
    public Event(final float triggerTime) {
        this.triggerTime = triggerTime;
        this.eventType = EventType.CREATE_ENEMY_MISSILE_EVERYTHING;
    }

    /**
     * Sets the trigger time to the trigger time of the parameter. sets the
     * eventType to the eventType of the parameter
     * 
     * @param triggerTime triggerTime
     * @param eventType eventType
     */
    public Event(final float triggerTime, final EventType eventType) {
        this.triggerTime = triggerTime;
        this.eventType = eventType;
    }

    /**
     * Sets the trigger time to the trigger time of the parameter. sets the
     * eventType to the eventType of the parameter sets the argument to true and
     * sets the argumentValue to the argument of the parameter
     * 
     * @param triggerTime triggerTime
     * @param eventType eventType
     * @param argument argument
     */
    public Event(final float triggerTime, final EventType eventType,
            final int argument) {
        this.triggerTime = triggerTime;
        this.eventType = eventType;
        this.argument = true;
        this.argumentValue = argument;
    }

    /**
     * Sets the eventType.
     * 
     * @param eventType
     *            eventType
     */
    public final void setEventType(final EventType eventType) {
        this.eventType = eventType;
    }

    /**
     * Returns the eventType.
     * 
     * @return eventType
     */
    public final EventType getEventType() {
        return eventType;
    }

    /**
     * Returns the trigger time.
     * 
     * @return triggerTime
     */
    public final float getTriggerTime() {
        return triggerTime;
    }

    /**
     * Returns true or false of the argument.
     * 
     * @return true or false
     */
    public final boolean hasArgument() {
        return argument;
    }

    /**
     * Returns the argementValue.
     * 
     * @return argumentValue
     */
    public final int getArgument() {
        return this.argumentValue;
    }

    /**
     * Holds the event types (CREATE_ENEMY_MISSILE_NO_TURRETS,
     * CREATE_ENEMY_MISSILE_ONLY_TURRETS, CREATE_ENEMY_MISSILE_EVERYTHING,
     * SET_MISSILEBAYSTOCK).
     * 
     */
    public enum EventType {
        CREATE_ENEMY_MISSILE_NO_TURRETS,
        CREATE_ENEMY_MISSILE_ONLY_TURRETS,
        CREATE_ENEMY_MISSILE_EVERYTHING,
        SET_MISSILEBAYSTOCK
    }
}
